home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 426-450 / disk_443 / dice / beginner.doc < prev    next >
Text File  |  1992-05-06  |  10KB  |  265 lines

  1.  
  2. beginner/help                        beginner/help
  3. beginner/beginner                    beginner/beginner
  4. beginner/beginner_readme                beginner/beginner_readme
  5.  
  6.                BEGINNER'S DOCUMENT FOR DICE
  7.  
  8.     (I)     The C Language
  9.  
  10.     (II)    Your first program, from start to end
  11.  
  12.  
  13.                      (I)
  14.                    THE C LANGUAGE
  15.  
  16.     It is not possible to describe the entirety of the C language in a
  17.     simple document file.  If you have no experience with the C language
  18.     and are trying to learn it the best thing to do is go to your local
  19.     bookstore (that has a computer section hopefully) and buy TWO different
  20.     C language books.  Really, TWO.  Look for a tutorial style book and
  21.     for a reference style book.  The tutorial style book will have many
  22.     self contained source examples that you can simply type in and run...
  23.     and figure things out by hacking on the examples and seeing the results.
  24.     The reference style book will have a comprehensive description of all
  25.     the standard calls available.  BE SURE YOU GET BOOKS THAT DESCRIBE ANSI C
  26.     rather than the original K&R C.  DICE is nearly 100% an ANSI C compiler
  27.     including nearly all the standard ANSI C functions.
  28.  
  29.     DME, the editor that comes with DICE, has a quick-reference capability
  30.     that allows you to place the cursor over a function name, hit a key, and
  31.     have the manual page for that function brought up in a separate window.
  32.     As you get familiar with DME please try out this function.    The key
  33.     sequence is control-right_bracket from DME.  If you have your own editor
  34.     that is able to generate standard ascii files you may use that in lieu of
  35.     DME.  However, note that DME was designed with programming in mind and
  36.     *does* have that quick-reference capability, and so once learned will
  37.     probably be more efficient for your purposes.
  38.  
  39.                      (II)
  40.              FIRST PROGRAM FROM START TO END
  41.  
  42.     After installing DICE boot your system.  If you run from the workbench
  43.     you must open a CLI or Shell window to fool around with DICE.
  44.  
  45.     NOTE:   From workbench the path might not be properly set up.  If
  46.     you:
  47.  
  48.     1> DCC
  49.  
  50.     and it comes back command not found, and DCC *does* exist on the floppy
  51.     or in-memory, then the path may not be properly set up.
  52.  
  53.  
  54.     (1) Creating the source code.  CD into some scratch directory... I use
  55.     T: here.
  56.  
  57.     1> CD T:
  58.  
  59.     (2) Edit a new file.  You do not have to RUN the editor, but it is always
  60.     nice because you can run the compiler without exiting the editor. This
  61.     tutorial expects you to RUN the editor:
  62.  
  63.     1> RUN DME test.c
  64.  
  65.     (3) DME brings up an editor window on the workbench.  Pressing the
  66.     right mouse button should bring up a menu (assuming you are not
  67.     already familiar with DME and installed it from the DICE disks).
  68.     IF DME DOES NOT HAVE A MENU then the right mouse button will
  69.     probably iconify the window instead.  This means you forgot to
  70.     copy DCC:S/.EDRC into S: ... again, this file already exists if
  71.     you simply booted with a copy of the distribution disk so you should
  72.     see a menu.
  73.  
  74.     Um, that was just to make sure DME is configured right... you can let
  75.     go of the RMB (right mouse button) now.  If you flip through the
  76.     menu items available you will note that many options have keyboard
  77.     equivalents.  For further information on mapping keys to your own
  78.     macros read the DCC2:MAN/DME.DOC document.  You can read the
  79.     document by putting the DCC2: floppy into DF0: and selecting the
  80.     Project/Open-NewWin menu option (this brings up a new window so
  81.     you now have two, though the first one is covered.  To use the
  82.     same window use the Project/Open-Replace menu option).
  83.  
  84.     (4) Type in your program.  The cursor keys may be used to move
  85.     around.  control-cursor_key skips multiple lines while
  86.     shift-cursor_key skips to the top or bottom of the file.
  87.     Typing RETURN on the last line adds a new line to the file.
  88.     Typing RETURN in general inserts a new line after the current
  89.     line.
  90.  
  91.          BASIC DME KEY COMMANDS, REFER TO DCC2:MAN/DME.DOC FOR MORE
  92.          INFORMATION.  These comprise only a few of the many commands
  93.          available.  You can construct your own key macros and menu
  94.          options to your whim as you get better.
  95.  
  96.     <cursor-key>        move the cursor around.
  97.  
  98.     ctl-<cursor-key>    skip around
  99.  
  100.     shift-<cursor-key>  move to top of text, bottom of text, first column,
  101.                 or end-of-line
  102.  
  103.     <del>            delete a character.  Experiment with <del> and
  104.                 <backspace> to determine the differences between
  105.                 the two.
  106.  
  107.     shift-<del>        delete a LINE
  108.  
  109.     ctl-i            control-i, go into insert mode
  110.     ctl-o            control-o, go into overwrite mode
  111.  
  112.     alt-i            ICONIFY WINDOW.  Window becomes iconified (very,
  113.                 very small)... unclutters the workbench screen.
  114.                 You may uniconify by selecting the iconified
  115.                 window and hitting the right mouse button.
  116.  
  117.     help            brings up a new window (as in <f3>) with
  118.                 DCC2:MAN/DME.DOC in it.
  119.  
  120.  
  121.                 FILE LOAD, SAVE
  122.         All of these have equivalent Menu options
  123.  
  124.     <f1>            Insert a file.  The current filename and file
  125.                 in the window stays, but some other file is
  126.                 inserted into the current text... experiment
  127.                 with this with a few small text files.
  128.  
  129.     <f2>            Edit a new file... replaces the current window
  130.                 with a new file.  The old file is gone (not
  131.                 deleted, just not being edited any more).  If
  132.                 you made modifications to the current file a
  133.                 requester will pop up asking you if you want
  134.                 to really throw it away.
  135.  
  136.     <f3>            Edit a new file... opens up a new window for the
  137.                 new file after you type in the file name, the
  138.                 previous file window is still there though
  139.                 probably obscured... you can move and resize
  140.                 the windows however you wish.
  141.  
  142.     <f9>            save file
  143.  
  144.     <f10>            save file and close window (exits DME if this is
  145.                 the last window)
  146.  
  147.     c-q            Quit - same as the close window gadget.
  148.  
  149.  
  150.     (4A)    PROGRAM?  What Program?  This program:
  151.  
  152.     -------- top of file (this line not part of file) --------
  153.  
  154.     #include <stdio.h>
  155.     #include <stdlib.h>
  156.  
  157.     main()
  158.     {
  159.         puts("Hello World!");
  160.         return(0);
  161.     }
  162.  
  163.     -------- bottom of file (this line not part of file) -----
  164.  
  165.     (5) COMPILING THE PROGRAM
  166.  
  167.     Write out the file with F9
  168.  
  169.     You can either quit out of the editor or simply bring your CLI
  170.     window forward to compile the program.    Better, iconify the editor
  171.     window to unclutter your workbench screen!  To compile the program,
  172.     enter this line:
  173.  
  174.     1> dcc test.c -o test
  175.  
  176.     This tells DICE to compile and link test.c into an executable.    DICE
  177.     should grind on the file and then return another CLI prompt.  If any
  178.     requester comes up you are missing an assignment or two:
  179.  
  180.     DINCLUDE:    you are missing the DINCLUDE: assignment which
  181.             should be set to DCC:INCLUDE.
  182.  
  183.     DLIB:        you are missing the DLIB: assignment which should
  184.             be set to DCC:DLIB.
  185.  
  186.     "Unable to open dlib:Amigas.lib or dlib:dlib:amigas.lib"
  187.  
  188.         Means that you do not have amigas.lib installed in
  189.         DLIB: ... Amigas.LIB is Amiga.LIB after being put through
  190.         the LIBTOS program and comes with the registered version
  191.         of DICE.
  192.  
  193.     (6) RUN THE PROGRAM
  194.  
  195.     1> test
  196.     Hello World!
  197.     1>
  198.  
  199.     You can make the program residentable by compiling with the -r
  200.     option. A -r compiled program's executable will have the PURE bit
  201.     set and may optionally be made resident.  Programs not compiled
  202.     with the -r option may not be made resident.
  203.  
  204.     1> dcc test.c -o test -r
  205.     1> test
  206.     Hello World!
  207.     1> resident test
  208.     1> test
  209.     Hello World!                <- much faster response!
  210.  
  211.     (7) ***** WARNING ***** ABOUT RESIDENTED EXECUTABLES
  212.  
  213.     It is a COMMON mistake when a programmer is making modifications
  214.     and recompiling a program to forget to REMOVE the program from
  215.     the resident list if it was placed on it.  I.E.
  216.  
  217.     1> resident test REMOVE
  218.  
  219.     The reason is simple... you make a change and recompile your
  220.     program.  However, you have already been the program resident.
  221.     If you run the program the 'old' version will be run.  Thus, you
  222.     want to either remove it from the resident list or re-resident
  223.     the executable.
  224.  
  225.     You can also force a program to be loaded from disk by providing a
  226.     full path to it.  I.E.
  227.  
  228.     1> resident test
  229.     1> test
  230.     Hello World!        <- uses resident version
  231.  
  232.     1> DF0:test        (or wherever you compiled test to)
  233.     Hello World!        <- uses disk version
  234.  
  235.  
  236.     (8)     PROGRAM EXAMPLES
  237.  
  238.     The registered DICE distribution comes with a large number of program
  239.     examples that should prove invaluable to a beginner.  Additionally,
  240.     every manual page includes a self-contained program example for
  241.     the particular function the page describes and this also should
  242.     prove invaluable when confusion arises.
  243.  
  244.     The second DICE disk, DCC2: contains both the manual pages,
  245.     library source, and utility examples.  The third DICE disk,
  246.     DCC3: contains the full source to the DME editor.  To compile
  247.     a utility or DME you must provide a semi-permanent place for
  248.     the objects ... make some directories and assign DTMP: ... refer
  249.     to the DMakefile files in the DCC2:dutil and DCC3:dutil/dme/src
  250.     directories.  These contain comments on what is necessary and
  251.     it can also be determined by scanning the DMakefile itself.
  252.  
  253.     To run a DMakefile type the DMAKE command on the directory
  254.     containing the DMakefile.  I'm afraid the DMake is a huge
  255.     hack and not much good documentation is available for it, but
  256.     what documentation there is is in DCC2:MAN/DMAKE.DOC
  257.  
  258.     (9)
  259.     That terminates the tutorial.  Refer to the DCC:DOC and DCC2:MAN
  260.     directories for documents describing other executables (use DME
  261.     to bring these files up and browse through them).  Note that the
  262.     top few lines of each file contain a keyword that gives DME it's
  263.     quick-reference capability to the file.
  264.  
  265.